package com.dk.service.impl;

import com.dk.pojo.Content;
import com.dk.mapper.ContentMapper;
import com.dk.service.ContentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 张成涛
 * @since 2021-08-12
 */
@Service
public class ContentServiceImpl extends ServiceImpl<ContentMapper, Content> implements ContentService {

    @Autowired
    private ContentMapper contentMapper;

    @Override
    public List<Content> toSelect() {
        return contentMapper.selectList(null);
    }

    @Override
    public void toInster(Content content) {
        contentMapper.insert(content);
    }

    @Override
    public void toUpdate(Content content) {
        contentMapper.updateById(content);
    }

    @Override
    public void toDelete(Integer contentId) {
        contentMapper.deleteById(contentId);
    }

}
